feat(sdk): add random and uuid4 in workflow context#1412
Merged
Conversation
chris-olszewski
marked this pull request as ready for review
July 17, 2026 13:43
Sushisource
reviewed
Jul 17, 2026
| (), | ||
| ChildWorkflowOptions { | ||
| workflow_id: "abandoned-child".to_owned(), | ||
| workflow_id: Some("abandoned-child".to_owned()), |
Member
There was a problem hiding this comment.
This makes me kinda sad. We probably need to convert ChildWorkflowOptions into a builder?
Member
Author
There was a problem hiding this comment.
Yeah, realized it wasn't marked as #[non_exhaustive] either which needed to be addressed before GA. Added a ChildWorkflowOptions::workflow_id constructor for the common case where only workflow id needs to get set.
| <T as private::Sealed>::sample(random) | ||
| } | ||
|
|
||
| fn uuid4(&self) -> String { |
Member
There was a problem hiding this comment.
Do we not have a dep already that can do this?
Member
Author
There was a problem hiding this comment.
uuid was already in temporalio-sdk, but not in temporalio-workflow. Pulled it down.
chris-olszewski
force-pushed
the
olszewski/feat_random_utils
branch
from
July 21, 2026 16:11
37533a2 to
98c81e6
Compare
Sushisource
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
WorkflowContext::randomanduuid4for use in workflowsWorkflowRandomValueas our trait to allow generating different number types. Used to avoid exposing underlyingrandtrait.WorkflowContext::random_seed()uuid4to generate oneWhy?
SDK parity
Checklist
Closes [Feature Request] Provide random utilities #1385
How was this tested:
Various unit tests
Any docs updates needed?
N/A